package com.kstech.mp3604.utils

import android.content.Context
import android.content.pm.PackageInfo
import android.content.pm.PackageManager

object VersionUtil {
    fun getAppVersionName(context: Context): String? {
        var appVersionName = ""
        try {
            val packageInfo: PackageInfo =
                context.applicationContext.packageManager.getPackageInfo(context.packageName, 0)
            appVersionName = packageInfo.versionName
        } catch (e: PackageManager.NameNotFoundException) {
            throw e
        }
        return appVersionName
    }
}